<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>

<script>
function deleteSingle(byval,parent)
{
	if(confirm("确认删除么？"))
	{
		document.getElementById(byval).checked=true;
		document.forms[0].action="/OpenAuthWebApplication/menu/menuDeleteAction!delete.action?oper=delete&parent="+parent;
		document.forms[0].submit();
	}
}
function updateSingle(byval,parent)
{
	alert(parent);
	document.getElementById("menuId").value=byval;
	document.forms[0].action="/OpenAuthWebApplication/menu/menuInitAction!init.action?oper=update&parent="+parent;
	document.forms[0].submit();
}
</script>
<jsp:include page="/public/public.jsp"/>
</head>
<body>
<jsp:include page="/public/head.jsp"/>  
    <div class="wrapper clearfix">
    <jsp:include page="/public/left.jsp"/>  
	<div class="main">
<s:form name="menu" action="menuListAction!list.action" namespace="/menu">
<table class="advert-tab" cellspacing="0">
<tr class="advert-th">
		<th colspan="6" style="text-align:left;">菜单管理&lt;&lt;菜单信息列表
		
		<s:if test="#request.menuId==0">
		&lt;&lt;根菜单
		</s:if>
		<s:else>
		&lt;&lt;
		<a href="/OpenAuthWebApplication/menu/menuListAction!list.action?parent=<s:property value="#request.prevMenu" />&menuId=<s:property value="#request.prevMenu" />"><s:property value="#request.menuName" /></a>
		</s:else>
		</th>
	</tr>
	<tr>
		<td >菜单名称</td>
		<td ><input type="text" name="menuName" value="${menuName }"/></td>
		<td >菜单描述</td>
		<td><input type="text" name="menuDesc" value="${menuDesc }"/></td>
			<td colspan=2 style="text-align:right;">
			<input type="submit"  value="查询"/>&nbsp;
			<input type="button" onclick="location.href='/OpenAuthWebApplication/menu/menuInitAction!init.action?oper=save&parent=${parent }'" value="添加"/>&nbsp;
			<input type="hidden" value="${menuId }" name="menuId" id="menuId"/>
		</td>	
	</tr>
</table>
<table class="advert-tab" cellspacing="0">
	<s:if test="#request.list.size==0">
	<tr>
		<td colspan="6">
			没有需要显示的数据！
		</td>
	</tr>
	</s:if>
	<s:else>
	<tr class="advert-th">
		<th>&nbsp;</th>
		<th>操作</th>
		<th>操作</th>
		<th>菜单名称</th>
		<th>菜单描述</th>
		<th>唯一标识</th>
	</tr>
	<s:iterator  value="#request.actionPageBean.data" id="menu" status="menulist">
	<tr>
		<td><input type="checkbox" name="menuIds" id="chk_<s:property value="#menu.menuId" />" value="<s:property value="#menu.menuId" />"/></td>
		<td><a href="javascript:updateSingle('<s:property value="#menu.menuId" />','${menuId }')">修改</a></td>
		<td><a href="javascript:deleteSingle('chk_<s:property value="#menu.menuId" />','${menuId }')">删除</a></td>
		<td><a href="/OpenAuthWebApplication/menu/menuListAction!list.action?parent=<s:property value="#menu.menuId" />&menuId=<s:property value="#menu.menuId" />&menuName=<s:property value="#menu.menuName" />"><s:property value="#menu.menuName" /></a>&nbsp;</td>
		<td><s:property value="#menu.menuDesc" />&nbsp;</td>
		<td><s:property value="#menu.uuid" />&nbsp;</td>
	</tr>
	</s:iterator>
	</s:else>
</table>

<table class="advert-tab" cellspacing="0">
<tr>
	<td>
		<input type="hidden" name="currentPageNo" value="${currentPageNo}"/>
		<input type="hidden" name="prevPageNo" value="${prevPageNo}"/>
		<input type="hidden" name="nextPageNo" value="${nextPageNo}"/>
		<input type="hidden" name="totalCount" value="${totalCount}"/>
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/menu/menuListAction!getFirstPage.action'" value="首 页"/>&nbsp;
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/menu/menuListAction!getPrevPage.action'" value="上一页"/>&nbsp;
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/menu/menuListAction!getNextPage.action'" value="下一页"/>&nbsp;
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/menu/menuListAction!getLastPage.action'" value="末 页"/>&nbsp;
	</td>
</tr>
</table>

</s:form>
</div>
</div>
<%@ include file="/public/footer.jsp"%>
</body>
</html>